var myDate=new Date();
var date=myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate();
var time=myDate.getTime();
function $_GET(a){
	var b=window.location.search.substring(1);var c=b.split("&");
	for(var i=0;i<c.length;i++){var d=c[i].split("=");if(d[0]==a){return d[1]}}
	return(false)
}
var dm=$_GET('dm');
if(dm==''){
	url=window.location.href.split("/");
	dm=url[4]
}
var bgc = '';
function navStr(a){	
	let idp = '&nbsp;&nbsp;<input id="date1" type="text" placeholder="请输入日期" readonly style="line-height:1;max-width: 88px;"/>&nbsp;';
	var b=$_GET('bg');
	if(b!=false)
		bgc="&bg="+b;
	else b='';
	$('nav').html('\t<span class="border-right"><tt></tt><small id="subtit"></small>'+(a=='lszt'?idp:'')+'</span><a class="border-right orange zt" href="###">涨因</a><a class="border-right orange dxb" href="dxb.html?'+bgc+'">短线宝</a><a class="border-right orange lszt" href="lszt.html?'+bgc+'">历史涨停</a><a class="border-right orange kfp" href="kfp.html?'+bgc+'">快复盘</a><a class="border-right orange ztg" href="ztg.html?'+bgc+'">涨停股</a><a class="border-right orange zbg" href="zbg.html?'+bgc+'">炸板</a><a class="border-right orange dtg" href="dtg.html?'+bgc+'">跌停股</a><a class="border-right orange qsg" href="qsg.html?'+bgc+'">强势股</a><a class="border-right orange zzt" href="zzt.html?'+bgc+'">昨日涨停</a><a class="border-right orange kx" href="kx.html?'+bgc+'">快讯</a>');
	$('#subtit').html($('.'+a).html());
	$('.'+a).removeClass("orange").addClass('text-danger')	
}
function infoHTML(){
	/*
	html='<a href="http://www.xlm.cc/" class="text-info" id="xlm">短线宝</a>www.xilimao.com自2021年3月上线以来，因用户体验好，大大提升了看盘复盘效率，深受好评。<br>但由于相关内容许可证没有批下来。目前网站已暂时关停，恢复日期待定。<br>当前插件是本地版，因不在服务器上无法整合来自付费数据接口，暂时不显示个股总额、开盘成交额、封单等数据。<br>本地插件无法提供人气排行、竞价历史数据、表头排序功能！<br>还有部分本地插件能支持但考虑到容易被篡改，暂时不提供！';
	$('#info').html(html)
	*/
	$('#info').html('');
}
function footHTML(){
	/*
	html='<a href="#xlm" onclick="hideInfo(1)" class="closebtn cbtn">关闭说明</a><a href="#xlm" onclick="hideInfo(0)" class="openbtn cbtn">展开</a><div class="container-fluid"><div class="row border-top border-secondary"><div class="col-12 col-sm-6 " id="infos"><div class=" infor px-2"><div class="pt-1"><mark>公开直播/软件更新 提醒群</mark></div><div class="p-1 rounded mb-1 ">群长期禁言，加1个即可。<br />特训学员已有微信群，不要重复加粉丝群。<br />QQ1群：<span class="orange font-num1" id="Q1">10047 86945</span><br />QQ2群：<span class="orange font-num1" id="Q2">63970 8338</span><br /><br />钉钉1群：<span class="orange font-num1">4477 1787</span><br />钉钉2群：<span class="orange font-num1">4477 1788</span><br />钉钉4群：<span class="orange font-num1">4477 1754</span><br />钉钉5群：<span class="orange font-num1">4477 1755</span><br />钉钉3群：<span class="orange font-num1">3328 5009 447</span><br />钉钉6群：<span class="orange font-num1">2656 5026 285</span><br /></div></div></div><div class="col-12 col-sm-6" id="zt"><div class=" text-center py-2 fz_12">直播方式：腾讯会议<br />会议号码：<span class="orange" id="hynum">557-236-216</span><br />直播时间：每周二四中午12:00<br /><a name="qr" id="qr" target="_blank" href="https://pan.baidu.com/s/11Ps8T6p6W8dgUy3vGnKIUg?pwd=gan0" class="orange" title=""> 通达信短线犀利版免费下载</a><br ><a name="qr" id="qr" target="_blank" href="http://www.xiniuge.cn/kc/" class="orange" title="">量化牛股全方位特训PRO课程</a><br >公众号①:<span class="text-danger">犀牛股</span> ②:<span class="text-danger">量化逻辑</span><div><img src="img/zhuli-xl-128.png?d=0310" style="width:128px;max-width:98%" alt=""></div></div></div></div></div>';
	$('footer').append(html)
	*/
	$('footer').append('');
}
function urlencode(a){
	a=(a+'');
	return encodeURIComponent(a).replace(/!/g,'%21').replace(/\'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2a').replace(/%20/g,'+')
}
function numYi(n){
	n=(n/100000000)+"亿";
	return n
}
function zhangDie(n){
	if(n>0)
		return 'red';
	else if(n<0)
		return 'green';
	else return ''
}
function ban(a){
	a=a.replace("新上市未开板","新股");
	a=a.replace("首板","1板");
	a=a.replace("昨日","昨");
	a=a.replace("破板","炸板");
	return a
}
function ztSe(t){
	if(t.indexOf("昨")==0)
		return 'white';
	if(t=='1板')
		return 'orange';
	else if(t=='')
		return '';
	else if(t=='新股')
		return'gray';
	else if(t=='炸板')
		return'zb';
	else if(t=='破板')
		return 'zb';
	else 
		return'purple'
}
function pobanSe(a){
	if(a=='破板')
		return'zb';
	else 
		return''
}
function liangbiSe(n){
	if(n>1)
		return'red';
	else if(n<1)
		return'green';
	else 
		return''
}
function huanshouSe(n){
	if(n>60)
		return'green';
	else if(n<30)
		return'';
	else 
		return'orange'
}
function jeSe(n){
	var a=10000*10000;
	if(n>=20*a)
		return'm20yi';
	else if(n<20*a&&n>=10*a)
		return'm10yi';
	else 
		return''
}
function numPer(n){
	n=n.toFixed(2)+'%';
	return n
}
function numPer100(n){
	return (n*100).toFixed(2)+'%'
}
function num2(n){
	n=n.toFixed(2);
	return n
}
function numCN(m){
	m=parseInt(m);
	if(m>=100000000||m<=-100000000){
		m=m/100000000;
		if(m<100)
			return m.toFixed(2)+'亿';
		else 
			return m.toFixed(0)+'亿'
	}else if(m==0)
		return'--';
	else 
		return(m/10000).toFixed(0)+'万'
}
function in_array(a,b){
	for(var i=0;i<b.length;i++){
		if(a===b[i]){return true}
	}
	return false
}
String.prototype.padLeft=function(a,b){var c=String(this);while(c.length<a){c=b+c}return c};
function riQi(t,n){
	const timestamp=t*1000;
	const date=new Date(timestamp);
	const year=date.getFullYear();
	const month=(date.getMonth()+1).toString().padLeft(2,'0');
	const day=date.getDate().toString().padLeft(2,'0');
	const hours=date.getHours().toString().padLeft(2,'0');
	const minutes=date.getMinutes().toString().padLeft(2,'0');
	const seconds=date.getSeconds().toString().padLeft(2,'0');
	var a;
	if(n==1)a=`${year}-${month}-${day}`;
	else if(n==2)a=`${hours}:${minutes}:${seconds}`;
	else if(n==3)a=`${hours}:${minutes}`;
	else a=`${year}-${month}-${day}${hours}:${minutes}:${seconds}`;
	return a
}
function riQi2(t,n){return t}
function randomStr(n){
	const characters='abcdefghijklmnopqrstuvwxyz0123456789';
	let result='';
	for(let i=0;i<n;i++){
		result+=characters.charAt(Math.floor(Math.random()*characters.length))
	}
	return result
}
function shownews(c){
	if(c==1){
		$('td').hide();$('td.text-danger').show()
	}else 
		$('td').show()
}
function ztHTML(a,b,c){
	var d='';
	var e='';
	var f=last=0;
	if(c=='limit_up'){
		f=a.first_limit_up;last=a.last_limit_up
	}else{
		f=a.yesterday_first_limit_up;last=a.yesterday_last_limit_up
	}
	yy='';
	r=a.surge_reason.related_plates;
	for(var i=0;i<r.length;i++){
		if(i>0)
			yy+='+';
		yy+=r[i].plate_name
	}
	d+='<div class="overflow-hidden h_20 px_5"><a href="###" class="font-num1 orange riqi">'+riQi(f,1)+'</a>';
	d+=' <mark>'+yy+'</mark>';
	d+='</div>';d+='<div class="overflow-hidden h_20 px_5 mb_5">';
	d+='<small class="d-inline-block w_60 pr-2">'+riQi(f,2)+'</small>';
	if(last!=f)
		e=riQi(last,2);
	d+='<small class="d-inline-block w_60 pr-1">'+e+'</small>';
	d+='<small class="d-inline-block text-right w_60">'+num2(a.price)+'元</small>';
	d+='<small class="d-inline-block text-right w_55">'+num2(a.change_percent*100)+'%</small>';
	d+='</div>';d+='<div class="bg-0 p_5">';
	d+=a.surge_reason.stock_reason.replace(/；/gi,"；<br>");
	d+='</div>';
	return d
}
function ztyy(e,o,f){
	var g='https://flash-api.xuangubao.cn/api/pool/detail';
	$.getJSON(g,{pool_name:f},function(a){
		var d=a.data;
		var b='';
		var c='';
		for(var i=0;i<d.length;i++){
			if(d[i].symbol==e+".SZ"||d[i].symbol==e+".SH"||d[i].symbol==e+".SS"){
				c+='<div id="zt'+i+'">';
				c+=ztHTML(d[i],e,f);
				c+='</div>'
			}
		}
		$('#'+o).html(c)
	})
}
function ztYY(c){
	if(c!=''){
		if(c.substring(0,1)=='1'){
			var d="可转债";
			for(i in kzz){
				if(c==kzz[i][0]){
					c=kzz[i][2];
					d=kzz[i][1];
					break
				}
			}
			nav='<h6 class="border-bottom-1 mb-0 border lh_2">'+d+' '+c+' <small>关联正股</small></h6>';
			$('nav').before(nav)
		}
	}
	if(zt[c]!='undefined'){
		a=zt[c];
		$('#zt-his a').html(a[1]);
		$('#zt-his mark').html(a[5]);
		$('#zt-his small.pr-2').html(a[2]);
		$('#zt-his small.e').html(numCN(a[4]));
		$('#zt-his small.c').html(num2(a[3])+'元');
		$('#zt-his .desc').html(a[6].replace(/；/gi,"；<br>"))
	}
	var e='https://www.iwencai.com/unifiedwap/result?querytype=stock&w=%E4%B8%AA%E8%82%A1%E5%8C%85%E5%90%AB@@%E6%A6%82%E5%BF%B5&qs=index_rewrite&tdxmyietitle=$_概念查询 | 犀牛哥&tdxmyiewidth=960&tdxmyieheight=600&canchangesize=1';
	if(hy[c]!='undefined'){
		b=hy[c];
		$('#mc').html(b[0]);
		$('#hangye').html(b[1]);
		var f=b[2].split(";");
		var g='';
		for(var i=0;i<f.length;i++){
			if(in_array(f[i],['标普道琼斯A股','融资融券','转融标的','注册制次新股','深股通','沪股通','MSCI概念','富时罗素概念股','转融券标的','同花顺漂亮100','富时罗素概念','分拆上市意愿']))
				continue;
			g+='<a target="_wencai" class="orange fz_14" href="'+e.replace("@@",f[i]).replace('$',f[i])+'" target="_blank">'+f[i]+'</a>、'
		}
		g=g.substr(0,g.length-1);
		$('#gainian').html(g)
	}
}
function compare(a,b){
	return b.length-a.length
}
jQuery.ajaxSetup({async:false});
Vue.filter('riQi3',function(n){t=riQi(n,3);if(t=='08:00')return'';else return t});
Vue.filter('riQi3B',function(b,a){if(b<a)return'';else{b=riQi(b,3);if(b=='08:00')return'';else return b}});
Vue.filter('num2',function(n){return num2(n)});
Vue.filter('numCN',function(n){return numCN(n)});
Vue.filter('num102',function(n){return num2(n*100)});
Vue.filter('zhangDie',function(n){return zhangDie(n)});
Vue.filter('numPer100',function(n){return numPer100(n)});
Vue.filter('moreInfo',function(s){
	if(s && typeof(s.related_plates)!=='undefined'&&s.related_plates!==null){
		str='';
		for(var i=0;i<s.related_plates.length;i++){
			if(i>0)str+="+";
			str+=s.related_plates[i].plate_name
		}
		str='<a href="zt.html?dm='+s.symbol.replace('.SZ','').replace('.SS','').replace('.SH','')+'&tdxmyietitle=xxxxxx_'+urlencode('涨停原因')+'&tdxmyiewidth=600&tdxmyieheight=400&canchangesize=1&" class="text-info">'+str+'</a> ';
		str+=s.stock_reason;
		return str
	}
	else return false
});
Vue.filter('dm',function(t){return t.replace(".SH",'').replace(".SZ",'').replace(".SS",'')});
Vue.filter('ntnb',function(t,b){if(b>1)return t+'天'+b+'板';else return''});
Vue.filter('len',function(n){return n.length});
var urlz='https://flash-api.xuangubao.cn/api/pool/detail';
function hideInfo(n){
	if(n==1){
		$.cookie("xlm_close","close");
		$('footer').addClass('hidefooter')
	}else{
		$.cookie("xlm_close",null);
		$('footer').removeClass('hidefooter')
	}
	console.log($.cookie("xlm_close"))
}
function infoBtn(){
	if($.cookie("xlm_close")=='close')$('footer').addClass('hidefooter')
}
function skin(){
	var a=$_GET('bg');
	var b=true;
	if(a!=false){
		if(a.replace(/\\0/gi,'')=='')
			a='000001';
		$('body').css("background-color","#"+a);
		if(parseInt(a,16)>6710886)
			b=false
	}else 
		a='000001';
	if(b)
		$('body').addClass("xldark").removeClass('light');
	else 
		$('body').addClass("light")
}